<?php
// leagues list page
require_once 'view/adm/content/leagues.index.php';
require_once 'model/common/session.php';


class LeaguesIndexPage extends PageController {

	var $form;

    function LeaguesIndexPage() {
        parent::PageController();

        $this->form =& new FormController();
        $this->form->addChild('apply', new ButtonController(new Delegate($this, 'apply')));
        $this->form->setDefaultChild('apply');


        $this->addChild('FilterForm', $this->form);
        $this->setDefaultChild('FilterForm');


        $this->setDefaultView(new Handle('LeaguesListView', array('/adm/content/leagues.index.html')));

        $this->addView('success', WACT_DEFAULT_VIEW);
        $this->addView('notfound', WACT_DEFAULT_VIEW);
        $this->addView('delete', new Handle('RedirectView', array('/delete')));
    }

     //apply filter
    //save filter response model into session
    function apply(&$source, &$request, &$responseModel) {
    	//print 'Applying filter...';
    	Session::saveResponseModel($responseModel,'filter.leagues');
    }
}

?>